import xadmin
from operation.models import UserComment, UserConsultation, UserCourse, UserFavorite, UserMessage


class UserConsultationAdmin:
    list_display = ('name', 'telephone', 'course', 'created')
    search_fields = ('name', 'telephone', 'course')
    list_filter = ('name', 'telephone', 'course', 'created')


class UserCommentAdmin:
    list_display = ('user', 'course', 'comment', 'created')
    search_fields = ('user', 'course', 'comment')
    list_filter = ('user', 'course', 'comment', 'created')


class UserCourseAdmin:
    list_display = ('user', 'course', 'created')
    search_fields = ('user', 'course')
    list_filter = ('user', 'course', 'created')


class UserFavoriteAdmin:
    list_display = ('user', 'favorite_id', 'favorite_type', 'created')
    search_fields = ('user', 'favorite_id', 'favorite_type')
    list_filter = ('user', 'favorite_id', 'favorite_type', 'created')


class UserMessageAdmin:
    list_display = ('user', 'message', 'has_read', 'created')
    search_fields = ('user', 'message', 'has_read')
    list_filter = ('user', 'message', 'has_read', 'created')


xadmin.site.register(UserConsultation, UserConsultationAdmin)
xadmin.site.register(UserComment, UserCommentAdmin)
xadmin.site.register(UserCourse, UserCourseAdmin)
xadmin.site.register(UserMessage, UserMessageAdmin)
xadmin.site.register(UserFavorite, UserFavoriteAdmin)
